< previous page page_97 next page >

Page 97
analysis.gifThe Unload keyword is a statement that will unload any form. Me is a keyword that refers to the current form. You should always use Me when referring to the current form, rather than the form name. This way, your code is much more generic and can be copied from one form to another with no changes. This code will cause the QueryUnload() and Unload() events to fire on a form.

EXERCISE
Try Out the Project
1. Run the project.
2. Change some of the data in one of the text boxes to enable the Save button.
3. Click() the Save button to disable it.
4. Click() the Close command button to make the form unload.
analysis.gifWhen you click the Close command button on the last form loaded, the Visual Basic application stops executing because there are no more forms loaded and running. This causes you to return to the Visual Basic design environment.

Frame Events
There are events associated with the frame control; however, in most instances, you will not use them. Frames are generally just used to contain other controlsthe user will not interact with the frame that much. The most common event you might use is the Click() event.
Option Button Events
Option buttons have one important event you need to write some code for. Just like data being changed in a text box causes the Change event fires, if the user clicks an option button, the Click() event fires, signifying that the data has changed.

 
< previous page page_97 next page >

If you like this book, buy it!